package com.woniuxy.creditsystem.common.mapper;

import com.woniuxy.creditsystem.common.bean.FinanceInfo;
import com.woniuxy.creditsystem.common.bean.OverdueStatisticsInfo;
import com.woniuxy.creditsystem.statisticsmag.page.PageRequest;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 逾期统计mapper
 * @author 刘川
 *
 */
@Mapper
public interface OverdueStatisticsMapper {

    /**
     * 分页查询
     * @param overdueStatisticsInfo 条件
     * @return
     */
    List<FinanceInfo> findAllByParams(@Param("p") PageRequest request, @Param("o") OverdueStatisticsInfo overdueStatisticsInfo);


    /**
     * 新增逾期统计方法(定时任务)
     * @param overdueStatisticsInfo
     * @return
     */
    @Insert("insert into overdue_statistics_info (lending_date,loan_order_nums,first_overdue," +
            "overdue_two_day,overdue_three_day,overdue_seven_day,overdue_fourteen_day,overdue_thirty_day," +
            "overdue_sixty_day) values (#{o.lendingDate},#{o.loanOrderNums},#{o.firstOverdue}," +
            "#{o.overdueTwoDay},#{o.overdueThreeDay},#{o.overdueSevenDay},#{o.overdueFourteenDay}," +
            "#{o.overdueThirtyDay},#{o.overdueSixtyDay})")
    int saveOverdueStatistices(@Param("o") OverdueStatisticsInfo overdueStatisticsInfo);



}
